import {formatDate} from '@angular/common';
import {User, UserType} from '../entity/TT';

export class Utils {

    static GetUinFromParticipant(participant: string): string {
        return participant.split('-')[0];
    }

    static MillsToHHMMSS(mills: number) {
        return formatDate(mills, 'HH:mm:ss', 'en-US', '+0000');
      }

      static MillsToMMSS(mills: number) {
        return formatDate(mills, 'mm:ss', 'en-US', '+0000');
      }

    // static GetVideoSize(vo: VideoSize) : OSize{
    //     switch (vo){
    //         case VideoSize.SMALL:
    //         return {width: 72, height: 58};
    //         case VideoSize.MIDDLE:
    //         return {width: 200, height: 124};
    //     }
    // }

    static now(): Date {
        return new Date();
    }

    static nowTime() {
        return this.now().getTime();
    }

    static isTeacher(u: User): boolean {
      return u.userType === UserType.Teacher;
    }
}
